from  serverApp  import  znServer
import  uvicorn
from  znServerConfig import znServerConfig
import  sys
import  os





if __name__=='__main__':
    znServerConfig['tdb']['sqlPath'] = os.getcwd() + "/sqls"
    znServerConfig['db']['sqlPath'] = os.getcwd()+"/sqls"
    znServer.setSettings(znServerConfig)

    #znServer.settings = znServerConfig
    znServer.load()
    #znServer.postPoints()
    #znServer.writeData20250101()


    znServer.startMqtt()
    #znServer.startTimer()
    uvicorn.run(
        "serverApp:app" ,
        host=znServerConfig['server']['host'] ,
        port=znServerConfig['server']['port']
    )